Runstats is a script developed by Thomas Kyte that compares the two different methods of doing the same thing to get a better result.1. AuthorizationSelect On v_$statname to Livan; Grant succeeded. SQLSelect on v_$mystat to Livan; Grant succeeded. SQLSelect on v_$timer to Livan; Grant succeeded. SQLSelect on v_$latch to Livan; Grant succeeded.2. Create a ViewSql> Conn livan/Livanconnected.sql>Create or replace view stats2 as Select 'STAT ...'||a.nam
Runstats can compare two different methods for the same thing to find out who is better. We only need to provide two different methods, and runstats is responsible for the rest of the tasks. Runstats is only a measurement of three elements:
1. Time consumed.
2. system statistics: displays the number of times each method performs something (such as executing a res
:
# cd/usr/lpp/db2_07_01/instance
#./db2idrop Instname
List all DB2 instances:
Copy Code code as follows:
# Cd/usr/lpp/db2_07_01/bin
#./db2ilist
Create a catalog for a database
Copy Code code as follows:
$ DB2 Catalog DB Btpdbs On/db2catalog
Canceling a cataloged database Btpdbs
Copy Code code as follows:
$
from TAB76.IXF of Ixf Commitcount, insert into Achact"DB2 "CREATE table achact_t like Achact"DB2 "Rename table achact_t to Achact"DB2 "INSERT INTO achact_t select * from Achact where txndt>= (select Lstpgdt fromAcmact where Actno=achact.actno) "DB2 get snapshot for Dynaimic SQL on Jining To delete an instance: # cd/us
/usr/lpp/db2_07_01/instance
#./db2idrop Instname
List all DB2 instances:
# Cd/usr/lpp/db2_07_01/bin
#./db2ilist
Create a catalog for a database
$ DB2 Catalog DB Btpdbs On/db2catalog
Canceling a cataloged database Btpdbs
$ DB2 Uncatalog DB Btpdbs
View version
# Db2level
Show current Database Admin instance
$ DB2 Get Ins
timely manner? To ensure that the DB2 optimizer works properly, the following methods are provided in DB2.
RUNSTATS and REOGCHK
The Runstats command is mainly used to collect the status information of database objects, which is crucial for the database to use a reasonable access plan. In general, we need to use
.
Others include partition/node group information and table space information. How can we update this information in a timely manner? To ensure that the DB2 optimizer works properly, the following methods are provided in DB2.
RUNSTATS and REOGCHK
The Runstats command is mainly used to collect the status information of
information in a timely manner? To ensure that the DB2 optimizer works properly, the following methods are provided in DB2. RUNSTATS and REOGCHK Runstats are mainly used to collect the status information of database objects, which is crucial for the database to use a reasonable access plan. In general, in the followin
timely manner? To ensure that the DB2 optimizer works properly, the following methods are provided in DB2.
1. RUNSTATS and REOGCHK
The Runstats command is mainly used to collect the state information of database objects, which is crucial for the DB2 database to use a reason
-v "Select Tbname, Nleaf, Nlevels, Stats_timefrom sysibm.sysindexes"
Db2-v Terminate
28. Run statistics on a table
Db2-v Runstatson Table Tab_nameand Indexes all
29. See if Runstats has been executed on the database
Db2-v "Select Tbname, Nleaf, Nlevels, Stats_timefrom sysibm.sysindexes"
30. Change the size
#./Db2ilistCreate a catalog for a database$ DB2 catalog dB btpdbs on/db2catalogCancel the compiled destination database btpdbs$ DB2 uncatalog dB btpdbsView version# Db2levelDisplays the current database management instance$ DB2 get instanceSet whether the instance is automatically started when the system starts.$ Db2iauto-on automatic start$ Db2iauto-off does not
:# Cd/usr/lpp/db2_07_01/bin#./db2ilistCreating catalogs for databases$ DB2 Catalog DB Btpdbs On/db2catalogCanceling a cataloged database Btpdbs$ DB2 Uncatalog DB BtpdbsView version# Db2levelDisplay the current database management instance$ DB2 Get InstanceSets whether the instance system starts automatically when it starts.$ db2iauto-on Auto-start$ db2iauto-off d
Lstpgdt fromAcmact where Actno=achact.actno) "DB2 get snapshot for Dynaimic SQL on JiningTo delete an instance:# cd/usr/lpp/db2_07_01/instance#./db2idrop InstnameList all DB2 instances:# Cd/usr/lpp/db2_07_01/bin#./db2ilistCreating catalogs for databases$ DB2 Catalog DB Btpdbs On/db2catalogCanceling a cataloged database Btpdbs$
/db2_07_01/bin#./db2ilistCreating catalogs for databases$ DB2 Catalog DB Btpdbs On/db2catalogCanceling a cataloged database Btpdbs$ DB2 Uncatalog DB BtpdbsView version# Db2levelDisplay the current database management instance$ DB2 Get InstanceSets whether the instance system starts automatically when it starts.$ db2iauto-on Auto-start$ db2iauto-off does not start
$ DB2 Catalog DB Btpdbs On/db2catalogCanceling a cataloged database Btpdbs$ DB2 Uncatalog DB BtpdbsView version# Db2levelDisplay the current database management instance$ DB2 Get InstanceSets whether the instance system starts automatically when it starts.$ db2iauto-on Auto-start$ db2iauto-off does not start automaticallyDatabase Optimization Commands:Reorg, Runs
$ DB2 Catalog DB Btpdbs On/db2catalogCanceling a cataloged database Btpdbs$ DB2 Uncatalog DB BtpdbsView version# Db2levelDisplay the current database management instance$ DB2 Get InstanceSets whether the instance system starts automatically when it starts.$ db2iauto-on Auto-start$ db2iauto-off does not start automaticallyDatabase Optimization Commands:Reorg, Runs
InstnameList all DB2 instances:# Cd/usr/lpp/db2_07_01/bin#./db2ilistCreating catalogs for databases$ DB2 Catalog DB Btpdbs On/db2catalogCanceling a cataloged database Btpdbs$ DB2 Uncatalog DB BtpdbsView version# Db2levelDisplay the current database management instance$ DB2 Get InstanceSets whether the instance system
properly, the following methods are provided in DB2.
1. RUNSTATS and REOGCHK
The Runstats command is mainly used to collect the status information of database objects, which is crucial for the database to use a reasonable access plan. In general, we need to use runstats to collect statistics in the following situation
information in a timely manner? To ensure that the DB2 optimizer works properly, the following methods are provided in DB2.
1. RUNSTATS and REOGCHK
The Runstats command is mainly used to collect the state information of DB2 database objects, which is crucial for the databas
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.